home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 November / PCWorld_2006-11_cd.bin / v cisle / feedreader / FeedReader306Setup.exe / {app} / udf / fbudf.sql < prev    next >
Text File  |  2005-12-24  |  7KB  |  207 lines

  1. /*
  2.  *
  3.  *     The contents of this file are subject to the Initial
  4.  *     Developer's Public License Version 1.0 (the "License");
  5.  *     you may not use this file except in compliance with the
  6.  *     License. You may obtain a copy of the License at
  7.  *     http://www.ibphoenix.com/idpl.html.
  8.  *
  9.  *     Software distributed under the License is distributed on
  10.  *     an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
  11.  *     express or implied.  See the License for the specific
  12.  *     language governing rights and limitations under the License.
  13.  *
  14.  *
  15.  *  The Original Code was created by Claudio Valderrama C. for IBPhoenix.
  16.  *  The development of the Original Code was sponsored by Craig Leonardi.
  17.  *
  18.  *  Copyright (c) 2001 IBPhoenix
  19.  *  All Rights Reserved.
  20.  */
  21.  
  22.  
  23. /*This file defines the new udfs for firebird.*/
  24.  
  25. set sql dialect 3;
  26.  
  27. -- The Nvl family is deprecated. Use native COALESCE instead.
  28. --FBUDF_API paramdsc* idNvl(paramdsc* v, paramdsc* v2)
  29. declare external function invl
  30. int by descriptor, int by descriptor
  31. returns int by descriptor
  32. entry_point 'idNvl' module_name 'fbudf';
  33.  
  34. --FBUDF_API paramdsc* idNvl(paramdsc* v, paramdsc* v2)
  35. declare external function i64nvl
  36. numeric(18,0) by descriptor, numeric(18,0) by descriptor
  37. returns numeric(18,0) by descriptor
  38. entry_point 'idNvl' module_name 'fbudf';
  39.  
  40. --FBUDF_API paramdsc* idNvl(paramdsc* v, paramdsc* v2)
  41. declare external function dnvl
  42. double precision by descriptor, double precision by descriptor
  43. returns double precision by descriptor
  44. entry_point 'idNvl' module_name 'fbudf';
  45.  
  46. --FBUDF_API paramdsc* sNvl(paramdsc* v, paramdsc* v2, paramdsc* rc)
  47. declare external function snvl
  48. varchar(100) by descriptor, varchar(100) by descriptor,
  49. varchar(100) by descriptor returns parameter 3
  50. entry_point 'sNvl' module_name 'fbudf';
  51.  
  52. -- The NullIf family is deprecated. Use native NULLIF instead.
  53. --FBUDF_API paramdsc* iNullIf(paramdsc* v, paramdsc* v2)
  54. declare external function inullif
  55. int by descriptor, int by descriptor
  56. returns int by descriptor
  57. entry_point 'iNullIf' module_name 'fbudf';
  58.  
  59. --FBUDF_API paramdsc* dNullIf(paramdsc* v, paramdsc* v2)
  60. declare external function dnullif
  61. double precision by descriptor, double precision by descriptor
  62. returns double precision by descriptor
  63. entry_point 'dNullIf' module_name 'fbudf';
  64.  
  65. --FBUDF_API paramdsc* iNullIf(paramdsc* v, paramdsc* v2)
  66. declare external function i64nullif
  67. numeric(18,4) by descriptor, numeric(18,4) by descriptor
  68. returns numeric(18,4) by descriptor
  69. entry_point 'iNullIf' module_name 'fbudf';
  70.  
  71. --FBUDF_API paramdsc* sNullIf(paramdsc* v, paramdsc* v2, paramdsc* rc)
  72. declare external function snullif
  73. varchar(100) by descriptor, varchar(100) by descriptor,
  74. varchar(100) by descriptor returns parameter 3
  75. entry_point 'sNullIf' module_name 'fbudf';
  76.  
  77. --FBUDF_API char* DOW(ISC_DATE* v, char* rc)
  78. declare external function dow
  79. timestamp,
  80. varchar(15) returns parameter 2
  81. entry_point 'DOW' module_name 'fbudf';
  82.  
  83. --FBUDF_API char* SDOW(ISC_DATE* v, char* rc)
  84. declare external function sdow
  85. timestamp,
  86. varchar(5) returns parameter 2
  87. entry_point 'SDOW' module_name 'fbudf';
  88.  
  89. --FBUDF_API paramdsc* right(paramdsc*, short* rl, paramdsc* rc)
  90. declare external function sright
  91. varchar(100) by descriptor, smallint,
  92. varchar(100) by descriptor returns parameter 3
  93. entry_point 'right' module_name 'fbudf';
  94.  
  95. --FBUDF_API ISC_TIMESTAMP* addDay(ISC_TIMESTAMP* v, int ndays)
  96. declare external function addDay
  97. timestamp, int
  98. returns timestamp
  99. entry_point 'addDay' module_name 'fbudf';
  100.  
  101. --FBUDF_API void addDay2(const ISC_TIMESTAMP* v0, const int& ndays, ISC_TIMESTAMP* v)
  102. declare external function addDay2
  103. timestamp, int, timestamp
  104. returns parameter 3
  105. entry_point 'addDay2' module_name 'fbudf';
  106.  
  107. --FBUDF_API ISC_TIMESTAMP* addWeek(ISC_TIMESTAMP* v, int nweeks)
  108. declare external function addWeek
  109. timestamp, int
  110. returns timestamp
  111. entry_point 'addWeek' module_name 'fbudf';
  112.  
  113. --FBUDF_API ISC_TIMESTAMP* addMonth(ISC_TIMESTAMP* v, int nmonths)
  114. declare external function addMonth
  115. timestamp, int
  116. returns timestamp
  117. entry_point 'addMonth' module_name 'fbudf';
  118.  
  119. --FBUDF_API ISC_TIMESTAMP* addYear(ISC_TIMESTAMP* v, int nyears)
  120. declare external function addYear
  121. timestamp, int
  122. returns timestamp
  123. entry_point 'addYear' module_name 'fbudf';
  124.  
  125. --FBUDF_API ISC_TIMESTAMP* addMilliSecond(ISC_TIMESTAMP* v, int nseconds)
  126. declare external function addMilliSecond
  127. timestamp, int
  128. returns timestamp
  129. entry_point 'addMilliSecond' module_name 'fbudf';
  130.  
  131. --FBUDF_API ISC_TIMESTAMP* addSecond(ISC_TIMESTAMP* v, int nseconds)
  132. declare external function addSecond
  133. timestamp, int
  134. returns timestamp
  135. entry_point 'addSecond' module_name 'fbudf';
  136.  
  137. --FBUDF_API ISC_TIMESTAMP* addMinute(ISC_TIMESTAMP* v, int nminutes)
  138. declare external function addMinute
  139. timestamp, int
  140. returns timestamp
  141. entry_point 'addMinute' module_name 'fbudf';
  142.  
  143. --FBUDF_API ISC_TIMESTAMP* addHour(ISC_TIMESTAMP* v, int nhours)
  144. declare external function addHour
  145. timestamp, int
  146. returns timestamp
  147. entry_point 'addHour' module_name 'fbudf';
  148.  
  149. --It will work only with Win32 until it's ported to another OS.
  150. --FBUDF_API ISC_TIMESTAMP* getExactTimestamp(ISC_TIMESTAMP* rc)
  151. declare external function getExactTimestamp
  152. timestamp
  153. returns parameter 1
  154. entry_point 'getExactTimestamp' module_name 'fbudf';
  155.  
  156. --It will work only with Win32 until it's ported to another OS.
  157. --FBUDF_API void getExactTimestampUTC(ISC_TIMESTAMP* rc);
  158. declare external function getExactTimestampUTC
  159. timestamp
  160. returns parameter 1
  161. entry_point 'getExactTimestampUTC' module_name 'fbudf';
  162.  
  163. --FBUDF_API int isLeapYear(const ISC_TIMESTAMP* v);
  164. declare external function isLeapYear
  165. timestamp
  166. returns int by value
  167. entry_point 'isLeapYear' module_name 'fbudf';
  168.  
  169. --FBUDF_API paramdsc* fbtruncate(paramdsc* v, paramdsc* rc)
  170. declare external function Truncate
  171. int by descriptor, int by descriptor
  172. returns parameter 2
  173. entry_point 'fbtruncate' module_name 'fbudf';
  174.  
  175. --FBUDF_API paramdsc* fbtruncate(paramdsc* v, paramdsc* rc)
  176. declare external function i64Truncate
  177. numeric(18) by descriptor, numeric(18) by descriptor
  178. returns parameter 2
  179. entry_point 'fbtruncate' module_name 'fbudf';
  180.  
  181. --FBUDF_API paramdsc* fbround(paramdsc* v, paramdsc* rc)
  182. declare external function Round
  183. int by descriptor, int by descriptor
  184. returns parameter 2
  185. entry_point 'fbround' module_name 'fbudf';
  186.  
  187. --FBUDF_API paramdsc* fbround(paramdsc* v, paramdsc* rc)
  188. declare external function i64Round
  189. numeric(18, 4) by descriptor, numeric(18, 4) by descriptor
  190. returns parameter 2
  191. entry_point 'fbround' module_name 'fbudf';
  192.  
  193. --FBUDF_API paramdsc* power(paramdsc* v, paramdsc* v2, paramdsc* rc)
  194. declare external function dPower
  195. double precision by descriptor, double precision by descriptor,
  196. double precision by descriptor
  197. returns parameter 3
  198. entry_point 'power' module_name 'fbudf';
  199.  
  200. --FBUDF_API blobcallback* string2blob(paramdsc* v, blobcallback* outblob)
  201. declare external function string2blob
  202. varchar(300) by descriptor,
  203. blob returns parameter 2
  204. entry_point 'string2blob' module_name 'fbudf';
  205.  
  206.  
  207.